Choosing the Log folder path

Hi to all,
In my requirement I have to log each and every operations performed by the script, to implement this Initially I have give option to user to select the log folder path. I have a script which will return the file name entered by the user. Similaly is there any way to get the folder path entered by the user.

string Log_File_Path(string title_str, initial_val)
{
string selectedFile = ""
DB fileDialog = create(title_str, styleCentered)
DBE fileSelectDBE = fileName(fileDialog, initial_val)
realize fileDialog

void doneSelection(DB db)
{
release db; /* must release */
hide db; /* hide before any accidental change by user */
}
close(fileDialog, true, doneSelection)

/* display and block */
block fileDialog

selectedFile = get fileSelectDBE; /* get the name */

/* free resource */
destroy fileDialog; fileDialog = null

return selectedFile;
}
string Log_file_Path = Log_File_Path("Choose the log file path", "");
print "Log file path = "Log_file_Path"\n"

if any one know how to do, please inform me.

Thank & Best regards
Azmath
azmath_india - Tue Apr 19 06:20:06 EDT 2011

Re: Choosing the Log folder path
llandale - Tue Apr 19 10:05:17 EDT 2011

Find the last forward or backward slash in the string, then take whatever comes before it.

Re: Choosing the Log folder path
azmath_india - Tue Apr 19 11:49:45 EDT 2011

llandale - Tue Apr 19 10:05:17 EDT 2011
Find the last forward or backward slash in the string, then take whatever comes before it.

hi,
Thanks for your reply.
Actually my need is mentioned below.

Once the script is started running -> Message Box will appear with Browser button -> User has to select the target folder path for the Log file -> the log file needs to be stored in that perticular path.

this is my requirement. I have mentioned one script in my previous post, which will reads the files path entered by the user and return the same,
similarly is there any way to read the target folder path entered by the user.

Thanks in advance
Azmath

Re: Choosing the Log folder path
llandale - Wed Apr 20 13:51:42 EDT 2011

azmath_india - Tue Apr 19 11:49:45 EDT 2011
hi,
Thanks for your reply.
Actually my need is mentioned below.

Once the script is started running -> Message Box will appear with Browser button -> User has to select the target folder path for the Log file -> the log file needs to be stored in that perticular path.

this is my requirement. I have mentioned one script in my previous post, which will reads the files path entered by the user and return the same,
similarly is there any way to read the target folder path entered by the user.

Thanks in advance
Azmath

smartDXL.com by Tony Goodman used to have a "directoryName" suite of functions that does this.

Re: Choosing the Log folder path
azmath_india - Thu Apr 21 08:01:50 EDT 2011

llandale - Wed Apr 20 13:51:42 EDT 2011
smartDXL.com by Tony Goodman used to have a "directoryName" suite of functions that does this.

llandale,
Thank you for your help, I solved the issue based on your input only.
Regards
Azmath